<template>
  <el-config-provider :locale="lang.messages(lang.get())">
    <router-view />
    <Autoupdate ref="autoupdate" />
    <Appupdate ref="appupdate" />
  </el-config-provider>
</template>

<script>
import { ref, nextTick } from 'vue'
import lang from '@/app/lang'
import server from '@/api/server'
import Autoupdate from '@/components/autoupdate'
import Appupdate from '@/components/appupdate'

export default {
  components: {
    Autoupdate,
    Appupdate
  },
  setup() {
    const autoupdate = ref()
    const appupdate = ref()

    nextTick(() => {
      setTimeout(() => {
        server.open()
        autoupdate.value.start()
        appupdate.value.start()
      }, 1000)
    })

    return { 
      lang,
      autoupdate,
      appupdate
    }
  }
}
</script>